home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / QuakeTools / src / libqbuild / rad.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-04  |  2.6 KB  |  105 lines

  1. #ifndef    RAD_H
  2. #define    RAD_H
  3. /*
  4.  * ============================================================================
  5.  * structures
  6.  * ============================================================================
  7.  */
  8.  
  9. // the sum of all tranfer->transfer values for a given patch
  10. // should equal exactly 0x10000, showing that all radiance
  11. // reaches other patches
  12. struct transfer {
  13.   unsigned short int patch;
  14.   unsigned short int transfer;
  15. } __packed;
  16.  
  17. struct patch {
  18.   struct winding *winding;
  19.   struct patch *next;                                   // next in face
  20.   int numtransfers;
  21.   struct transfer *transfers;
  22.   int cluster;                                       // for pvs checking
  23.   vec3_t origin;
  24.   struct dplane_t *plane;
  25.   bool sky;
  26.   vec3_t totallight;                                   // accumulated by radiosity
  27.   // does NOT include light
  28.   // accounted for by direct lighting
  29.   float area;
  30.   // illuminance * reflectivity = radiosity
  31.   vec3_t reflectivity;
  32.   vec3_t baselight;                                   // emissivity only
  33.   // each style 0 lightmap sample in the patch will be
  34.   // added up to get the average illuminance of the entire patch
  35.   vec3_t samplelight;
  36.   int samples;                                       // for averaging direct light
  37. } __packed;
  38.  
  39. struct triedge {
  40.   int p0, p1;
  41.   vec3_t normal;
  42.   vec_t dist;
  43.   struct triangle *tri;
  44. } __packed;
  45.  
  46. struct triangle {
  47.   struct triedge *edges[3];
  48. } __packed;
  49.  
  50. #define    MAX_TRI_POINTS        1024
  51. #define    MAX_TRI_EDGES        (MAX_TRI_POINTS*6)
  52. #define    MAX_TRI_TRIS        (MAX_TRI_POINTS*2)
  53.  
  54. struct triangulation {
  55.   struct dplane_t *plane;
  56.   int matrixsquare;
  57.   struct triedge **edgematrix;
  58.   int numpoints;
  59.   struct patch **points;
  60.   int numedges;
  61.   struct triedge *edges;
  62.   int numtris;
  63.   struct triangle *tris;
  64. } __packed;
  65.  
  66. /*
  67.  * ============================================================================
  68.  * globals
  69.  * ============================================================================
  70.  */
  71.  
  72. extern vec3_t *texreflectivity;
  73. extern vec3_t *radiosity;
  74. extern vec3_t *illumination;
  75. extern struct patch **facepatches;
  76. extern struct entity **faceentity;
  77. extern struct patch *patches;
  78. extern int numpatches;
  79. extern struct dplane_t *backplanes;
  80. extern int fakeplanes;
  81. extern int *leafparents;
  82. extern int *nodeparents;
  83. extern float subdiv;
  84. extern struct directlight **directlights;
  85. extern struct facelight *facelights;
  86. extern int numdlights;
  87. extern int numbounce;
  88. extern bool dumppatches;
  89. extern int junk;
  90. extern float ambient;
  91. extern float maxlight;
  92. extern float lightscale;
  93. extern float direct_scale;
  94. extern float entity_scale;
  95.  
  96. /*
  97.  * ============================================================================
  98.  * prototypes
  99.  * ============================================================================
  100.  */
  101.  
  102. void RadWorld(__memBase);
  103.  
  104. #endif
  105.